﻿using System;
namespace eg_075_构造函数重载
{
    public class Date
    {
        public readonly int Year;
        public readonly int Month;
        public readonly int Day;
        public Date(int year, int month, int day)
        {
            this.Year = year;
            this.Month = month;
            this.Day = day;
        }

        public override string ToString()
        {
            return string.Format("{0}年{1}月{2}日", this.Year, this.Month, this.Day);
        }
    }
    internal class Program
    {

        static void Main(string[] args)
        {
            Date yesterday = new Date(2012, 10, 15);            //实例化日期类型
            Console.WriteLine("昨天日期为：" + yesterday);

        }
    }
}